﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AllNews.aspx.cs" Inherits="Admin_NewsStat" MasterPageFile="~/Admin/MasterPage.master" %>

<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="MainContent">
<h1>Все статьи</h1>
    <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="false" CssClass="SiteStats"
        AllowPaging="true" AlternatingRowStyle-CssClass="SiteStatsA" RowStyle-CssClass="SiteStats"
        Width="98%" AllowSorting="true" OnSorting="gvNews_Sorting" OnRowDataBound="gvNews_RowBound"
         PagerSettings-Visible="true"  PageSize="60" 
        OnPageIndexChanging="gvNews_PageindexChanging" >
        <Columns>
            <asp:BoundField DataField="PublishDate" SortExpression="Date" HeaderText="Дата" HeaderStyle-CssClass="StatsHeader"/>
            <asp:BoundField DataField="Title" HeaderText="Статья" SortExpression="Title" HeaderStyle-CssClass="StatsHeader"/>
            <asp:CheckBoxField HeaderText="Популярная статья" DataField="IsPopular" HeaderStyle-CssClass="StatsHeader"/>
            <asp:CheckBoxField HeaderText="Показывать на сайте" DataField="Isvisible" HeaderStyle-CssClass="StatsHeader" />
            <asp:BoundField DataField="Views" HeaderText="Просмотров" SortExpression="Views" HeaderStyle-CssClass="StatsHeader"/>
            <asp:TemplateField HeaderText="Действие" HeaderStyle-CssClass="StatsHeader">
            <ItemTemplate>
               <asp:Button OnCommand="btnDeleteNews_Click" CausesValidation="false" UseSubmitBehavior="false" CommandArgument='<%# Eval("ArticleID") %>'
                    Text='удалить' ID="btnDeleteNews" CssClass="but" runat="server"  />
              <asp:Button OnCommand="btnEditNews_Click" UseSubmitBehavior="false" CommandArgument='<%# Eval("ArticleID") %>'
                    Text="редактировать" runat="server" ID="btnEditNews" CssClass="but" />
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>